package com.logicalthinking.animations;

import android.databinding.BindingAdapter;
import android.support.annotation.ColorRes;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.widget.ImageView;

import java.io.Serializable;

/**
 * Created by logicalthinking on 2017/4/28.
 */

public class Sample implements Serializable{
    private int color;
    private String name;

    public Sample(@ColorRes int color, String name){
        this.color = color;
        this.name = name;
    }

//    @BindingAdapter("bind:colorTint")
    @BindingAdapter(value = {"colorTint"}, requireAll = false)
    public static void setColorTint(ImageView view, @ColorRes int color){
        DrawableCompat.setTint(view.getDrawable(), color);

    }

    public String getName() {
        return name;
    }

    public int getColor() {
        return color;
    }
}
